/*
    Android UIML

	Copyright (C) 2010  Bram Goffings (bramgoffings@gmail.com)

	This program is free software; you can redistribute it and/or
	modify it under the terms of the GNU Lesser General Public License
	as published by the Free Software Foundation; either version 2.1
	of	the License, or (at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU Lesser General Public License for more details.

	You should have received a copy of the GNU Lesser General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

package uiml.android.elements;

import java.util.Hashtable;

import org.w3c.dom.Element;

/**
 * 
 * @author bram
 *
 */
public class Head extends UimlElement{
	
	// TODO comment
	private Hashtable<String, String> metaChildren;
	private String title;
	
	// TODO comment
	public final String TITLE = "title";
	public static String IAM = "head";
	
	/**
	 * 
	 * @param node
	 */
	public Head(Element node) {
		super(node);
		process();
	}
	
	/**
	 * 
	 */
	@Override
	public void processElement(Element elem) {	
		
		if(elem.getTagName().equals(Meta.IAM)) {
			Meta meta = new Meta(elem);
			metaChildren.put(meta.getName(), meta.getContent());
		}
		
		if(metaChildren.containsKey(TITLE))
			title = metaChildren.get(TITLE);
	}

	/**
	 * 
	 * @param metaChildren
	 */
	public void setMetaChildren(Hashtable<String, String> metaChildren) {
		this.metaChildren = metaChildren;
	}

	/**
	 * 
	 * @return
	 */
	public Hashtable<String, String> getMetaChildren() {
		return metaChildren;
	}

	/**
	 * 
	 * @param m_title
	 */
	public void setTitle(String m_title) {
		this.title = m_title;
	}

	/**
	 * 
	 * @return
	 */
	public String getTitle() {
		return title;
	}

}
